<?php
header("Content-type:text/html;charset=utf-8");
$id = $_POST["id"];
$image = $_POST["image"];
$title = $_POST["title"];
$edidata = $_POST["edidata"];
$color = $_POST["color"];
$buy= $_POST["buy"];
$num = $_POST["num"];
// $password = $_POST["password"];
// echo $username.''.$password;
$con = mysqli_connect("localhost", "root", "root","heisha");
if ($con) {
    // echo "连接成功";
}
// 2、执行SQL语句
// $sqlStr = "insert into student(username) values('$username','$password')";
$sqlStr = "insert into `goodslist`( `id `, `image`,`title`,`edition`,`color`,`buy`,`num`)
 values('$id','$image',`$title`,`$edidata`,`$color`,`$buy`,`$num`)";
	
		// values('$username')";
// $result = mysqli_query($con, $sqlStr);
$result = mysqli_query($con, $sqlStr);
// echo $result;
// echo "br";
//3、关闭数据库
mysqli_close($con);
// //三、给前端响应
if ($result == 1) {
    echo "1"; //表示注册成功
} else {
    echo "0"; //表示注册失败
    echo "注册失败";
}



?>	